﻿@model Website.Models.ViewModels.LogView
@{
    
}

<table class="logTable">
    <tr>
        <td>Tidspunkt</td>
        <td>Beskrivelse</td>
        <td>Type</td>
        <td>Bruger</td>
    </tr>
    @foreach (var logEntry in Model.List)
    {
        <tr>
            <td>@logEntry.Timestamp.ToShortDateString()</td>
            <td>@logEntry.Text</td>
            <td>@logEntry.ActionTypeName</td>
            <td>
                @if (logEntry.EditorID != null && Model.AllUsers.Any(x => x.ID == logEntry.EditorID))
                {
                    @Model.AllUsers.Single(x => x.ID == logEntry.EditorID).Name
                }
            </td>
        </tr>
    }
    
</table>